jupyter notebook添加虚拟环境,以及切换内核时出现ImportError: DLL load failed while importing 您所在的位置:网站首页 jupyter 导入模块 jupyter notebook添加虚拟环境,以及切换内核时出现ImportError: DLL load failed while importing

jupyter notebook添加虚拟环境,以及切换内核时出现ImportError: DLL load failed while importing

2023-03-14 17:12| 来源: 网络整理| 查看: 265

一、jupyter notebook添加虚拟环境

1. 打开cmd,activate到需要添加到jupyter notebook的虚拟环境;

activate gymlab

2. 在当前环境中安装好ipykernel;

conda install ipykernel

3. 添加环境到jupyter notebook;

python -m ipykernel install --name gymlab

重启jupyter notebook就可以看到新增的环境。

但是在切换环境时,出现了“ImportError: DLL load failed while importing _device: 找不到指定的模块”的报错。

原因:pyzmq的版本不匹配导致。因为pyzmq版本过高,pyzmq就是一个类似于框架一样的东西,可以让编程更加简单、简洁和性能更高,当版本太高时,就会与Jupyter Notebook出现不兼容的情况,从而导致错误。

二、切换内核时出现ImportError: DLL load failed while importing _device: 找不到指定的模块解决方案

具体解决办法为:在需要添加到jupyter notebook的环境下,降低pyzmq版本

pip install pyzmq==23.0.0

重新运行,即可解决。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有